package Servlet.ComprobantePago;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.swing.JOptionPane;

import com.huellas.bean.ListadoCitasComprobanteBean;
import com.huellas.negocio.GestionComprobantes;
import com.huellas.negocio.GestionReporteAtencionDiaria;

/**
 * Servlet implementation class AnularComprobanteServlet
 */
@WebServlet("/AnularComprobanteServlet")
public class AnularComprobanteServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public AnularComprobanteServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String Code = request.getParameter("code");
		GestionComprobantes gc = new GestionComprobantes();
		ListadoCitasComprobanteBean ObjCitas = new ListadoCitasComprobanteBean();
		try {
			ObjCitas.setCodComprobante(Integer.parseInt(Code));
			/*ObjCitas.setSerie("");
			ObjCitas.setFeEmisionComprobante("2001-01-01");
			ObjCitas.setRuc("204512458724");
			ObjCitas.setNumGuia(0);
			ObjCitas.setCita(0);*/
			String Respuesta = gc.Mantenimiento_Comprobantes(ObjCitas, "D");
			response.sendRedirect(request.getContextPath()+ "/ComprobantePago.jsp");
		} catch (Exception e) {
			System.out.println(e.getMessage());
			RequestDispatcher rd = request.getRequestDispatcher("error.jsp");
			rd.forward(request, response);
		}
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
